/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.app.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yanlight.app.request.DeveloperAddRequest;
import com.yanlight.app.request.DeveloperModifyRequest;
import com.yanlight.app.request.DeveloperQueryRequest;
import com.yanlight.app.service.DeveloperService;
import com.yanlight.support.http.Response;
import com.yanlight.util.ResponseUtil;

/**
 * 
 * @author haolw
 * @time 2018/03/02
 */
@RestController
@RequestMapping("/developer")
public class DeveloperController {
	@Autowired
	private DeveloperService developerService;

	@PostMapping("/list")
	public Response list(DeveloperQueryRequest request) {
		return ResponseUtil.success(developerService.findList(request));
	}
	
	@PostMapping("/add")
	public Response add(DeveloperAddRequest request) {
		developerService.insert(request);
		return ResponseUtil.success();
	}
	
	@PostMapping("/modify")
	public Response add(DeveloperModifyRequest request) {
		developerService.modify(request);
		return ResponseUtil.success();
	}
}
